<template>
  <div class="con">
    <div>
      <One />
      <Two v-for="item in list"
           :key="item.id"
           :detail="item" />
    </div>
  </div>
</template>

<script>
import One from "@/components/home/index/one";
import Two from "@/components/home/index/two";
// import from
export default {
  name: "",
  data() {
    return {
      list: []
    };
  },
  //注册组件
  components: {
    One,
    Two
  },
  created() {
    this.isinput();
  },
  mounted() {
    this.$postRequest('/api/goods/getClassList', {
      pageNum: 1,
      pageSize: 5
    }).then(res => {
      this.list = res.data.list
    })
  },
  methods: {
    isinput() {
      console.log("true");
      this.$store.commit("setDValue", true);
    },

  }
};
</script>
<style scoped lang="scss">
.con {
  background-color: #f9f9f9;
  & > div {
    width: 1400px;
    margin: auto;
  }
}
</style>